/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author tank
 */import java.util.Scanner;

public class task{


public static void main(String args[]){

    int sum = 0;
        System.out.println("input integer numbers,when the number is negative,will end:");
        Scanner sc= new Scanner(System.in);

        int nbr = 0;
        int input=0;
        int scope = 99999;
        int initial=0;
        int counter = 0;
        for(int i =0;;i++){
            if((input = sc.nextInt())>=nbr ){
            nbr=input;
 }
            if(input <=scope && input>=0){
                scope=input;
            }
            if(input<0){
                initial= sum/i;
                counter =i;
                break;
            }
            sum = sum+input;
        }

        System.out.println(" Sum: "+sum);
        System.out.println(" Largest : " + nbr);
        System.out.println(" Small :" + scope);
        System.out.println(" Average :" + initial);
        System.out.println(" count:" + counter );
}
}



